package com.ask.controller.user;

import com.ask.entity.Category;
import com.ask.result.Result;
import com.ask.service.CategorySerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController("userCategoryController")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    private CategorySerivce categorySerivce;

    @GetMapping("/list")
    public Result<List<Category>> list(Integer type){
        List<Category> categories = categorySerivce.list(type);
        return Result.success(categories);
    }
}
